#include "sort/sort.h"

#include <vector>

void bubbleSort(int arr[], const int n) {}

void countingSort(int arr[], const int n, const int maxValue)
{
    if (n <= 0 || maxValue <= 0)
        return;

    std::vector<int> counts(maxValue + 1, 0);
    for (int i = 0; i < n; i++) counts[arr[i]]++;

    int index = 0;
    for (int i = 0; i < counts.size(); i++)
    {
        for (int j = 0; j < counts[i]; j++)
        {
            arr[index++] = i;
        }
    }
}
